package com.university.logistic.util;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;

import java.util.List;

@Data
public class PageInfo {
    private long pageNum;
    private long pageSize;
    private long total;
    private long pages;//总页数
    private List<?> list;

    //无参构造
    public PageInfo(){

    }

    public PageInfo(Page<?> page){
        this.pageNum=page.getCurrent();
        this.pageSize=page.getSize();
        this.total=page.getTotal();
        this.pages=page.getPages();
        this.list=page.getRecords();
    }

    public PageInfo(IPage<?> page){
        this.pageNum=page.getCurrent();
        this.pageSize=page.getSize();
        this.total=page.getTotal();
        this.pages=page.getPages();
        this.list=page.getRecords();
    }
}
